package net.frenopatico.citadels.modules;

import lombok.extern.java.Log;
import net.frenopatico.citadels.view.windows.LoginWindow;

import com.google.inject.AbstractModule;
import com.google.inject.servlet.ServletScopes;

/**
 * Wire the windows to the application.
 *
 *
 * @author eduardo.ramirez.ronco@gmail.com
 *
 */
@Log
public final class WindowsModule extends AbstractModule {
    /**
     * Avoid instantiation.
     *
     */
    private WindowsModule() {
        super();
    }

    @Override
    protected void configure() {
        bind( LoginWindow.class ).in( ServletScopes.SESSION );

        log.info( String.format( "%s initialized", WindowsModule.class.getSimpleName() ) );
    }

    /**
     * Creates a new instance of the module.
     *
     * @return New instance of the module.
     */
    public static WindowsModule build() {
        return new WindowsModule();
    }
}
